<!DOCTYPE html>
<html class="x-admin-sm" xmlns:th="http://www.thymeleaf.org">
    
    <head>
        <meta charset="UTF-8">
        <title></title>
<!--        <meta name="renderer" content="webkit">-->
<!--        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">-->
<!--        <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />-->
        <link rel="stylesheet" th:href="@{/X-admin/css/font.css}">
        <link rel="stylesheet" th:href="@{/X-admin/css/xadmin.css}">
        <script th:src="@{/X-admin/lib/layui/layui.js}" charset="utf-8"></script>
        <script type="text/javascript" th:src="@{/X-admin/js/xadmin.js}"></script>
        <!--[if lt IE 9]>
          <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
          <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
        <![endif]-->
        <script th:src="@{/js/toExcel.js}"></script>
    </head>
    
    <body>
        <div class="x-nav">
            <span class="layui-breadcrumb">
                <a href="">首页</a>
                <a href="">演示</a>
                <a>
                    <cite>导航元素</cite></a>
            </span>
            <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
                <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i>
            </a>
        </div>
        <div class="layui-fluid">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-body ">
                            <form class="layui-form layui-col-space5" th:action="@{/student/getScoreBySchoolWithCondition/1}">
                                <div class="layui-input-inline layui-show-xs-block">
                                    <div class="layui-input-inline layui-show-xs-block">
                                        <select name="school">
                                            <option value="" name="school">学校分类</option>
                                            <option name="school" th:each="schoolName:${schoolName}" th:text="${schoolName.getSchool()}"
                                                    th:value="${schoolName.getSchool()}" th:selected="${school==schoolName.getSchool()}">
                                            </option>
                                        </select>
                                    </div>
                                    <div class="layui-input-inline layui-show-xs-block">
                                        <select name="gender" th:value="${gender}=='M'?'男':'女'">
                                            <option value="" name="gender" >性别</option>
                                            <option value="M" name="gender" th:selected="${gender=='M'}">男</option>
                                            <option value="F" name="gender" th:selected="${gender=='F'}">女</option>
                                        </select>
                                    </div>
                                    <div class="layui-inline layui-show-xs-block">
                                        <button class="layui-btn" lay-submit="" lay-filter="sreach">
                                            <i class="layui-icon">&#xe615;</i></button>
                                    </div>
                                </div>
                            </form>
                        </div>

                        <div class="layui-form-item">
                            <button type="button" style="float: right" class="layui-btn" id="excell" onclick="method5('dataTable')">导出为Excel</button>
                        </div>
                        <div class="layui-card-body ">
                            <table class="layui-table" lay-filter="test" id="dataTable">
                                <thead>
                                    <tr>
                                        <th>名次</th>
                                        <th>选手学号</th>
                                        <th>选手姓名</th>
                                        <th>性别</th>
                                        <th>学校</th>
                                        <th>电话号码</th>
                                        <th>邮箱</th>
                                        <th>个人总积分</th>
                                    </tr>
                                </thead>
                                <tbody>
                                <tr th:each="score:${pageInfo.list}">
                                    <td th:text="${(pageInfo.pageNum-1)*pageInfo.pageSize+1+scoreStat.index}"></td>
                                    <td th:text="${score.student.getId()}"></td>
                                    <td th:text="${score.student.getName()}"></td>
                                    <td th:text="${score.student.getGender()=='M'?'男':'女'}"></td>
                                    <td th:text="${score.student.getSchool()}"></td>
                                    <td th:text="${score.student.getPhone()}"></td>
                                    <td th:text="${score.student.getEmail()}"></td>
                                    <td th:text="${score.getPersonalScore()}"></td>
                                </tr>
                                </tbody>
                            </table>
                        </div>

                        <h3>当前第[[${pageInfo.getPageNum()}]]页，总共[[${pageInfo.getPages()}]]页，总共[[${pageInfo.getTotal()}]]条记录</h3>
                        <!--这里是分页信息--不带条件-->
                        <div class="layui-card-body " th:if="${sign=='getSports'}" >
                            <div class="page">
                                <a class="num" th:href="@{/student/toPersonalScore/1}" >首页</a>
                                <inline th:if="${pageInfo.hasPreviousPage}"><!--如果存在前一页-->
                                    <a class="prev" th:href="@{/student/toPersonalScore/}+${pageInfo.getPageNum()-1}">&lt;&lt;</a></inline>

                                <inline th:each="page:${pageInfo.getNavigatepageNums()}">
                                    <inline th:if="${page==pageInfo.getPageNum()}">
                                        <span class="current" th:text="${pageInfo.getPageNum()}"></span>
                                    </inline>
                                    <inline th:if="${page!=pageInfo.getPageNum()}">
                                        <a class="prev" th:text="${page}" th:href="@{/student/toPersonalScore/}+${page}"></a>
                                    </inline>
                                </inline>

                                <inline th:if="${pageInfo.hasNextPage}"><!--如果存在后一页-->
                                    <a class="next" th:href="@{/student/toPersonalScore/}+${pageInfo.getPageNum()+1}">&gt;&gt;</a></inline>
                                <a class="num" th:href="@{/student/toPersonalScore/}+${pageInfo.getPages()}" >末页</a>
                            </div>
                        </div>

                        <!--这里是分页信息--带条件-->
                        <div class="layui-card-body " th:if="${sign=='querySportsWithCondition'}" >
                            <div class="page">
                                <a class="num" th:href="@{/student/getScoreBySchoolWithCondition/1}" >首页</a>
                                <inline th:if="${pageInfo.hasPreviousPage}"><!--如果存在前一页-->
                                    <a class="prev" th:href="@{/student/getScoreBySchoolWithCondition/}+${pageInfo.getPageNum()-1}">&lt;&lt;</a></inline>

                                <inline th:each="page:${pageInfo.getNavigatepageNums()}">
                                    <inline th:if="${page==pageInfo.getPageNum()}">
                                        <span class="current" th:text="${pageInfo.getPageNum()}"></span>
                                    </inline>
                                    <inline th:if="${page!=pageInfo.getPageNum()}">
                                        <a class="prev" th:text="${page}" th:href="@{/student/getScoreBySchoolWithCondition/}+${page}"></a>
                                    </inline>
                                </inline>

                                <inline th:if="${pageInfo.hasNextPage}"><!--如果存在后一页-->
                                    <a class="next" th:href="@{/student/getScoreBySchoolWithCondition/}+${pageInfo.getPageNum()+1}">&gt;&gt;</a></inline>
                                <a class="num" th:href="@{/student/getScoreBySchoolWithCondition/}+${pageInfo.getPages()}" >末页</a>
                            </div>
                        </div>

                    </div>
                </div>
            </div>
        </div>
    </body>
    <script>layui.use('laydate',
        function() {
            var laydate = layui.laydate;

            //执行一个laydate实例
            laydate.render({
                elem: '#start' //指定元素
            });

            //执行一个laydate实例
            laydate.render({
                elem: '#end' //指定元素
            });

        });</script>
    <script>layui.use('table',
        function() {
            var table = layui.table;

            //监听单元格编辑
            table.on('edit(test)',
                function(obj) {
                    var value = obj.value //得到修改后的值
                        ,
                        data = obj.data //得到所在行所有键值
                        ,
                        field = obj.field; //得到字段
                    layer.msg('[ID: ' + data.id + '] ' + field + ' 字段更改为：' + value);
                });

            //头工具栏事件
            table.on('toolbar(test)',
                function(obj) {
                    var checkStatus = table.checkStatus(obj.config.id);
                    switch (obj.event) {
                        case 'getCheckData':
                            var data = checkStatus.data;
                            layer.alert(JSON.stringify(data));
                            break;
                        case 'getCheckLength':
                            var data = checkStatus.data;
                            layer.msg('选中了：' + data.length + ' 个');
                            break;
                        case 'isAll':
                            layer.msg(checkStatus.isAll ? '全选': '未全选');
                            break;
                    };
                });
        });</script>
</html>